package com.lmx.repoDomain.tmodel;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ForeignKey;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import io.katharsis.resource.annotations.JsonApiResource;
import io.katharsis.resource.annotations.JsonApiToOne;

/**
 * 执行报告表
 * 
 * @author ytche
 * @date 2017年4月17日
 * 
 */
@JsonApiResource(type = "executionReport")
@Table(name = "tnb_execution_report")
@Entity
public class ExecutionReport extends BaseEntity {

	private static final long serialVersionUID = 1L;

	private Integer createTime;
	private String title;
	private String content;
	private Integer checkScore;
	private Integer mealScore;
	private Integer sportScore;
	private Integer medicationScore;
	private Integer recoveryScore;

	private Customer customer;

	@JsonApiToOne
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.JOIN)
	@JoinColumn(name = "customer_id", foreignKey = @ForeignKey(name = "null"))
	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	@Column(name = "create_time")
	public Integer getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Integer createTime) {
		this.createTime = createTime;
	}

	@Column(name = "title")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "content")
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Column(name = "check_score")
	public Integer getCheckScore() {
		return checkScore;
	}

	public void setCheckScore(Integer checkScore) {
		this.checkScore = checkScore;
	}

	@Column(name = "meal_score")
	public Integer getMealScore() {
		return mealScore;
	}

	public void setMealScore(Integer mealScore) {
		this.mealScore = mealScore;
	}

	@Column(name = "sport_score")
	public Integer getSportScore() {
		return sportScore;
	}

	public void setSportScore(Integer sportScore) {
		this.sportScore = sportScore;
	}

	@Column(name = "medication_score")
	public Integer getMedicationScore() {
		return medicationScore;
	}

	public void setMedicationScore(Integer medicationScore) {
		this.medicationScore = medicationScore;
	}

	@Column(name = "recovery_score")
	public Integer getRecoveryScore() {
		return recoveryScore;
	}

	public void setRecoveryScore(Integer recoveryScore) {
		this.recoveryScore = recoveryScore;
	}

}
